{
	rank = $1;
	inNet = $2;
	onNode = $3;
	ownData = $4;
	
	
	aInNet[rank] += (inNet-ownData);
	aOnNode[rank] += (onNode-ownData);
	if (inNet-ownData > 0) {
		aRatio[rank] += (onNode-ownData) / (inNet-ownData)
	}
}

/LG-/ {
	numNodes++;
}

END {

for (r=0; r<=100; r++) {
	if (aInNet[r] > 0) {
		print r, aInNet[r], aOnNode[r], aOnNode[r]/aInNet[r], "(" aRatio[r]/numNodes ")";
	}
}

}